package com.digitalchina.lxnsy.viewholder;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.TopSortVO;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2017/11/28 11:45:58
 * 修改备注：
 * ================================================
 */

public class ChannelV2LeftHolder extends BaseViewHolder<TopSortVO> {

    private TextView tvName;
    private View view; // 左侧选中竖线

    public ChannelV2LeftHolder(ViewGroup parent) {
        super(parent, R.layout.item_chnnel_v2_left);

        tvName = $(R.id.tv_name);
        view = $(R.id.view);
    }

    @Override
    public void setData(final TopSortVO data) {
        super.setData(data);

        tvName.setText(data.getName());
        if (data.isSelect()){
            tvName.setTextColor(getContext().getResources().getColor(R.color.app_color));
            view.setBackgroundColor(getContext().getResources().getColor(R.color.app_color));
        }else{
            tvName.setTextColor(getContext().getResources().getColor(R.color.colorFontBlack));
            view.setBackgroundColor(getContext().getResources().getColor(R.color.colorWhite));
        }

    }

}
